package {
	import org.flixel.FlxG;
	/**
	 * @author NilsIH
	 */
	public class NiloUtils {
		
		public static function getRandomElement(array:Array, splice:Boolean = true):Object{
			var index:uint = Math.floor(Math.random() * (array.length));
			if (index >= array.length) index = array.length - 1;
			var obj:Object = array[index];
			if (splice) array.splice(index, 1);
			return obj;
		}
		
		public static function randomBoolean():Boolean {
			return (FlxG.random() * 10) > 5;
		}
		
		public static function numberIsOver(number:Number):Boolean{
			return FlxG.random() > number;
		}
		
	}
}
